﻿<%@ WebHandler Language="C#" Class="_4_IncreaseValueByDiv" %>

using System;
using System.Web;

public class _4_IncreaseValueByDiv : IHttpHandler {
    
    public void ProcessRequest (HttpContext context) {
        context.Response.ContentType = "text/plain";
        string ispostback = context.Request["ispostback"];
        string number =  "0";

        if ("true" == ispostback)
        {
            number = context.Request["number"];
            int value = Convert.ToInt32(number);
            value++;
            number = value.ToString();
        }

        string path = context.Server.MapPath("4_IncreaseValueByDiv.htm");
        string content = System.IO.File.ReadAllText(path);
        content = content.Replace("@number", number);
        context.Response.Write(content);
    }
 
    public bool IsReusable {
        get {
            return false;
        }
    }

}